<!DOCTYPE html	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:sdu="http://sduept.com/jsf/cc">
<h:head>
	<link href="/css/primefaces/menubase.css" rel="stylesheet"
		type="text/css" />
	<title>人员选择器</title>
	<style type="text/css">
.value {
	font-weight: bold;
}

.ui-datatable {
	margin-bottom: 25px;
}

.ui-datatable .ui-datatable-footer {
	text-align: right;
	background: none;
	background-color: none;
	background-image: none;
	border-bottom: 0pt;
	border-left: 0pt;
	border-right: 0pt;
}

.ui-datalist ul {
	padding: 0 0 0 10px;
	margin: 5px 0;
}

.ui-datatable .ui-button-icon-only .ui-button-text {
	padding: 0;
	line-height: 1.2;
}
</style>
</h:head>
<h:body>
	<!-- 
使用方法
在页面中
<p:commandButton value="选择执行人" icon="ui-icon-extlink" actionListener="#{flowDesignController.chooseUser()}">
<p:ajax event="dialogReturn"  oncomplete="PF('details').show()" listener="#{flowDesignController.onUsersChosen}" update="details" />
</p:commandButton>
在自己的业务controller中 添加如下方法
public void chooseUser() {
        Map<String,Object> options = new HashMap<String, Object>();
        options.put("resizable", false);
        options.put("draggable", false);
        options.put("modal", true);
        options.put("width", 300);
        options.put("height", 400);
        RequestContext.getCurrentInstance().openDialog("/module/common/org_selector_user_multiple", options, null);
    }
	public void onUsersChosen(SelectEvent event) {
		//返回的是List<PersonnelEntityBean>
		List<PersonnelEntityBean> users = (List<PersonnelEntityBean>) event.getObject();
	}
 -->
	<h:form id="orgtreeForm">
		<p:commandButton value="确定" icon="ui-icon-search"
			actionListener="#{orgSelectorController.selectUsersFromDialog}" />
		<p:tree 
			value="#{orgSelectorController.root}" var="node" dynamic="true"
			id="orgtree" widgetVar="orgtree" animate="true"
			selectionMode="checkbox"
			selection="#{orgSelectorController.selectedNodes}">
			<p:ajax event="expand" update="orgtree"
				listener="#{orgSelectorController.onNodeExpand}" />
			<p:treeNode icon="ui-icon-note">
				<h:outputText value="#{node.name}" />
			</p:treeNode>
			<p:treeNode type="dept" icon="ui-icon-document">
				<h:outputText value="#{node.name}" />
			</p:treeNode>
			<!-- <p:treeNode type="roleroot" icon="ui-icon-image">
				<h:outputText value="#{node}" />
			</p:treeNode>
			<p:treeNode type="role" icon="ui-icon-video">
				<h:outputText value="#{node.name}" />
			</p:treeNode> -->
			<p:treeNode type="user" icon="ui-icon-video">
				<h:outputText value="#{node.name}" />
			</p:treeNode>
		</p:tree>
	</h:form>
</h:body>
</html>
